package com.woniuxy.conf;


import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author: 曾令忠
 * @Description:
 * @Date: 2020/7/6 0006-下午 3:42
 */
@Configuration
public class RabbitConf {

    @Bean
    public Queue senderAckQueue(){
        return new Queue("senderAckQueue");
    }
    @Bean
    public DirectExchange senderExchange(){
        return new DirectExchange("senderDirectExchange");
    }
    @Bean
    public Binding bindingsenderAckQueueAndsenderExchange(Queue senderAckQueue,DirectExchange senderExchange){
        return BindingBuilder.bind(senderAckQueue).to(senderExchange).with("news");
    }
}
